<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="Stylesheet" type="text/css" href="doc.css" />
<title>EMF Model Transaction Overview</title>
</head>
<body>
<h1><a name="top">EMF Model Transaction Overview</a></h1>
<p>
The transaction framework provides the capability of managing access to an editing domain by
multiple reading and writing threads. It also provides a facility to register and share an
editing domain amongst different clients and listeners. Resource set listeners are defined
in the transaction layer and are provided with notifications in batches. The resource set listener 
has the option to append changes before the transaction is committed (pre-commit) or receive only 
the notifications of transactions that were validated and not rolled-back (post-commit). 
The following are the main extension points and classes to be used with the transaction framework:
<ol>
	<li>
	The extension point
	<a href="../extension-points/org_eclipse_emf_transaction_editingDomains.html">org.eclipse.emf.transaction.editingDomains</a>
	is used to declare an transactional editing domain unique identifier. This identifier can be used by clients to
	either construct the transactional editing domain if it doesn't already exist or find the editing domain from memory
	if it already exists.
	</li>
	<li>
	The extension point <a href="../extension-points/org_eclipse_emf_transaction_listeners.html">org.eclipse.emf.transaction.listeners</a>
	is used to declare listeners that should be automatically attached to an editing domain when it is first
	constructed. A listener can be registered against all, one or many editing domains.
	</li>
	<li>
	The <code>TransactionalEditingDomain</code> has two interfaces called <code>Registry</code> and <code>Factory</code>. 
	The <code>Registry</code> singleton
	can be used to add new transactional editing domains to the registry using a unique identifier or
	to retrieve (or construct) an editing domain from its unique identifier. The <code>Factory</code> has a default
	implementation that is used
	to construct new transactional editing domains. A <code>TransactionalEditingDomain</code> allows clients to
	add and remove their <code>ResourceSetListeners</code> as well as allowing clients to perform exclusive reads blocking
	any other reading / writing threads. Write access is obtained by executing an EMF-style command
	on the editing domain's command stack.
	</li>
	<li>
	Clients can use the <code>RecordingCommand</code> to automatically record the changes made by their subclass
	so that undo and redo can be done automatically. The client does not need to implement undo and
	redo in this case.
	</li>
	<li>
	A special <code>RunnableWithResult</code> class is provided so that clients can pass instances of this special <code>Runnable</code> to
	the <code>runExclusive()</code> method on a <code>TransactionalEditingDomain</code> and have their result propagated back
	to the caller of <code>runExclusive()</code>. This can help clients who are querying models and returning
	results back to the caller. 
	</li>
</ol>
</p>
	
<p>
Please refer to the tutorial <a href="../../tutorials/transactionTutorial.html">Transaction Tutorial</a>.
</p>

<hr/>

<p>
<a href="https://www.eclipse.org/legal/epl-2.0/">Copyright (c) 2006, 2007 IBM Corporation and others.</a>
</p>
</body>
</html>
